#include <stdio.h>

int main(){
    int a,b;
    printf("Enter two integers: ");
    scanf("%d %d",&a,&b);
    int min,max;
    min=a<b?a:b;
    max=a>b?a:b;
    int i,gcd;
    for(i=min;i>0;i--){
        if(min%i==0&&max%i==0){
            gcd=i;
            break;
        }
    }
    printf("%d\n",gcd);
    return 0;
}
